<%@page import="model.Role"%>
<%@page import="model.Staff"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<%
    Staff staff = (Staff) session.getAttribute("staff");

    if (staff == null) {
        response.sendRedirect(request.getContextPath() + "/Administration");
    } else if (!staff.getRoleList().contains(new Role(1))) {
        response.sendRedirect(request.getContextPath() + "/Administration/home");
    } else {
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Add Category</title>
          <link href="<%= request.getContextPath()%>/css/style_for_page.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_for_menu.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_addtion.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_for_warehousing.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/adMenu.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/tHeaderFooter.css" rel="stylesheet" type="text/css"/>
    </head>
      <body style="background-color: lightsteelblue;">
         <div class="headerbg">
            <div class="header"> 
                <%@include file="/include/mHeader.jsp" %>
            </div>
            <div class="adContent">
                <div class="adMenu">
                    <%@include file="/include/mMenu.jsp" %>
                </div>
            </div>
        </div>
        <div class="contentbg">
            <div class="content1" style="border-bottom:  1px black dashed; ">
                <div class="registerForm">
                    <h1>New Catelogue</h1>
                    
                    <s:form action="addcategory" namespace="/Administration/Catelogue">                                     
                        <table style="text-align: left; margin-left: 10px;">
                            <tr>
                                <td>
                                    <s:textfield tabindex="1" name="name" label="Category Name" size="30" /> 
                                </td>
                            </tr>
                            <tr>
                                <td>
                                     <s:textfield tabindex="2" name="description" label="Discription" size="30" />
                                </td>
                            </tr>
                             <tr>
                                <td>
                                     <s:select label="Select parent category" 
                                  list="categoriesName" 
                                  name="yourCategoriesName" cssStyle="width: 200px;"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <s:reset value="Reset" cssStyle="width: 96px" theme="simple" />
                                </td>
                                <td>
                                    <s:submit value="Add Category" cssStyle="width: 96px; margin-left: 132px" theme="simple" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2"><s:actionerror /></td>
                            </tr>
                        </table>
                    </s:form>
                </div>
                <div class="registerTerms">
                    <!--                        <h1>Register Notes</h1>
                                            </br>
                                            <p>- <b>All fields are required.</b></p>
                                            <p>- Phone should contain <b>only 10 digits.</b></p>
                                            <p>- Birth Date should be in <b>mm/dd/yyyy</b> format (e.g. 02/28/2000).</p>
                                            <p>- Login name must be from <b>6 to 30</b> characters.</p>
                                            <p>- Password must be from <b>6 to 30</b> characters.</p>
                                            <br>   -->
                </div>
            </div>
        </div>  
        <footer>
            <div id="footer">
                <%@include file="/include/iFooter.jsp" %>
            </div>   
        </footer>

    </body>
</html>
<%
    }
%>